More magical AA semantics D Programming Language Discussion
Updated: 2013-01-11 11:10:55
Entire D Site Library Reference Forum Newsgroup Archives D Programming Language Discussion beta digitalmars.D More magical AA semantics D Home Overview Features Downloads Tools Change Log Bug Tracker FAQ Appendices Acknowledgments Sitemap D1 Home Documentation Book 3 1. Tutorial 13. Concurrency Language Reference Library Reference How-tos Articles Community Forums GitHub Wiki Review Queue Twitter Links View mode : basic threaded horizontal-split Log in Help 3 hours ago More magical AA semantics Don Reply Consider this code : int[int x int k x[2 5 Error , range violation . Makes sense . x[2 x[2 5 But this works That is , x[2 doesn't exist , unless you are about to assign to it What happens is : 1. lvalue index creates x[2 sets it to int.init 2. rvalue index returns x[2 which is now 0 3.